
use global_BLAs_09_21_21, clear

drop if year<1945 | year>2021

*Unique dyad
egen udyad = tag(dyad_id)

*Time periods
gen time_int = ceil((year-1945)/10)

*Language
gen code_language = 1 if doc_language=="English" & copyavailable==1 & google_translate==0
replace code_language = 2 if google_translate==1 & copyavailable==1 & !regexm(doc_language, "Spanish") ///
	& !regexm(doc_language, "Portugese") & !regexm(doc_language, "Arabic")
replace code_language = 3 if copyavailable==1 & regexm(doc_language, "Arabic")
replace code_language = 4 if copyavailable==1 & regexm(doc_language, "Spanish")
replace code_language = 5 if copyavailable==1 & regexm(doc_language, "Portugese")
replace code_language = 6 if copyavailable==1 & missing(code_language)



*6) Share of copies and evidence over time

preserve

	collapse (mean) copyavailable evidence, by(time_int)
	
	#delimit ;
	
	graph bar copyavailable evidence, over(time_int, relabel (1 "1946-1955" 2 "1956-1965"
		3 "1966-1975" 4 "1976-1985" 5 "1986-1995" 6 "1996-2005" 7 "2006-2015" 8 "2016-2020") 
		label(labsize(*0.65) angle(0))) ylab(#10, angle(0) labsize(*0.8)) bar(1, c(gs6))
		bar(2, c(gs12)) graphregion(color(white)) legend(order(1 "Copy of BLA" 2 "Evidence of BLA"))
		name(bla_evid_time, replace);
	
	#delimit cr
	

restore
